package mysgoog.board;

import java.util.*;

import mysgoog.gtp.*;

public class HistoryEvent
{
    public final int turn;
    public final Color player;
    public final int pos;
    public final Set<Worm> captureWorms;
    public final PosSet captures;
    public final Set<Worm> cnctWorms;

    public HistoryEvent(int turn, Color player, int pos, Set<Worm> captureWorms, Set<Worm> cnctWorms)
    {
        this.turn = turn;
        this.player = player;
        this.pos = pos;
        this.captureWorms = new HashSet<Worm>();
        for (Worm worm : captureWorms)
            this.captureWorms.add(worm.clone());
        this.captures = new PosSet();
        for (Worm worm : captureWorms)
            for (Integer i : worm)
                captures.add(i);
        this.cnctWorms = new HashSet<Worm>();
        for (Worm worm : cnctWorms)
        {
            this.cnctWorms.add(worm.clone());
        }
    }
}
